package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Yancy xiao
 * @create 2023-01-04 17:02
 */
@Controller
public class testParam {
    /*@RequestMapping("/testgetparam")
    public String test(HttpServletRequest request) {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        System.out.println(username + password);
        return "success";
    }*/

    /*  @RequestMapping("/testgetparam")
      public String getParam(String username, String password) {
          System.out.println(username + password);
          return "success";
      }*/

    @RequestMapping("/testgetparam")
    public String getParam(@RequestParam(value = "username", required = false,defaultValue = "hello") String name, String password) {
        System.out.println(name + password);
        return "success";
    }
}
